
import 'package:syn_4s/core/model/base/base_query_model.dart';
import 'package:syn_4s/core/model/base/paged_list.dart';
import 'package:syn_4s/core/model/cctv_camera_model.dart';
import 'package:syn_4s/core/services/config.dart';

import '../model/base/api_result_data.dart';
import '../model/map_all_device_model.dart';
import '../utils/dio_utils.dart';

class SurveillanceRequest {

  static Future<ApiResultData<CCTVCameraModel>> getCCTV(int pageIndex, bool sort) async {
    print("$pageIndex");
    final url = "/api/device/cctv";
    var param = {
      "pageIndex" : pageIndex,
      "pageSize" : 3,
      "sort" : sort,
      "isPage" : true
    };
    final result = await DioUtils.instance.requestBaseUrl(url, method: HttpConfig.post, params: param);

    ApiResultData<CCTVCameraModel> apiResultData =
    ApiResultData<CCTVCameraModel>.fromJson(result, CCTVCameraModel.fromJson);
    return apiResultData;
  }
}